/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.edmo.fastener.jms;

import com.edmo.fastener.business.ListofCustomersnSuppliers;
import com.edmo.fastener.business.OrderProcessing;
import com.edmo.fastener.business.WorkQueue;
import java.util.Map;
import org.springframework.stereotype.Component;

/**
 *
 * @author obelog
 */
@Component
public class OrderListener {
    private static WorkQueue wq = new WorkQueue(10);
    
    public void orderReceived(Map<String, Object> message) throws Exception {
	    String filePath = (String) message.get("filePath");
            String fileName = (String) message.get("fileName");
            String orderId = (String) message.get("orderId");
	    wq.execute(new OrderProcessing(filePath, fileName, Long.valueOf(orderId)));
	  }
}
